package com.yonyou.pmclouds.reason.mapper;

import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import com.yonyou.pmclouds.reason.entity.ProblemReasonRefVO;
import com.yonyou.pmclouds.reason.entity.ProblemReasonVO;
import org.apache.ibatis.annotations.Param;

public interface ProblemReasonMapper extends BaseMapper<ProblemReasonVO> {

    int countCode(@Param("pkTenant") String pkTenant, @Param("scode") String scode, @Param("category") byte catetory);

    int countName(@Param("pkTenant") String pkTenant, @Param("sname") String sname, @Param("category") byte catetory);

    int countChild(String pkParent);

    ProblemReasonVO[] queryReasonsOfTenant(@Param("pkTenant") String pkTenant, @Param("enableStatus") byte enableStatus,
                                           @Param("category") byte category);

    ProblemReasonRefVO[] queryReasonsRefOfTenant(@Param("pkTenant") String pkTenant, @Param("category") Byte category);

    ProblemReasonRefVO[] queryRefVOByIds(String[] ids);

    ProblemReasonVO[] queryIdByNames(@Param("reasonNames") String[] reasonNames, @Param("tenantId") String tenantId);

    ProblemReasonVO[]  querySelfAndChildrenByCodeAndStatus(@Param("scode") String scode,
                                                           @Param("pkTenant") String pkTenant, @Param("enableStatus") byte enableStatus);
}
